package com.ruoyi.project.business.common.enums;

/**
 * @author thanks
 */
public enum HolidayType {

    /**
     * 调休
     */
    COMPENSATORY_LEAVE(1, "调休"),
    /**
     * 年假
     */
    ANNUAL_LEAVE(2, "年假"),
    /**
     * 病假
     */
    SICK_LEAVE(3, "病假"),
    /**
     * 事假
     */
    PERSONAL_LEAVE(4, "事假"),
    /**
     * 婚假
     */
    MARRIAGE_LEAVE(5, "婚假"),
    /**
     * 丧假
     */
    BEREAVEMENT_LEAVE(6, "丧假"),
    /**
     * 产假
     */
    MATERNITY_LEAVE(7, "产假"),
    /**
     * 陪产假
     */
    PATERNITY_LEAVE(8, "陪产假"),
    /**
     * 工伤假
     */
    WORK_INJURY_LEAVE(9, "工伤假"),
    /**
     * 产检假
     */
    PRENATAL_CHECKUP_LEAVE(10, "产检假"),
    /**
     * 流产假
     */
    ABORTION_LEAVE(11, "流产假"),
    /**
     * 哺乳假
     */
    BREASTFEEDING_LEAVE(12, "哺乳假")

    ;

    private Integer code;
    private String desc;

    HolidayType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static HolidayType valueOf(Integer code) {
        for (HolidayType each : values()) {
            if (each.getCode().equals(code)) {
                return each;
            }
        }
        return null;
    }
}
